package com.halflife.framework.participant;

import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TreeView implements Serializable {

    private static final long serialVersionUID = 1L;

    @Expose
    private Long id;
    @Expose
    private String text;
    @Expose
    private Long level;
    @Expose
    private Long tag;
    @Expose
    private String href;
    @Expose
    private Map<String, Boolean> state;
    @Expose
    private List<TreeView> nodes;

    public TreeView(){}

    public TreeView(Object id, Object text){

        this.id = Long.valueOf(id.toString());
        this.text = String.valueOf(text);
    }

    public TreeView(Object id, Object text, Object checked){

        this.id = Long.valueOf(id.toString());
        this.text = String.valueOf(text);
        if(checked!=null && !checked.toString().equals("")){


            Map<String, Boolean> map = new HashMap<String, Boolean>();
            map.put("checked", true);
            this.state = map;
        }
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Long getLevel() {
        return level;
    }

    public void setLevel(Long level) {
        this.level = level;
    }

    public Long getTag() {
        return tag;
    }

    public void setTag(Long tag) {
        this.tag = tag;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public List<TreeView> getNodes() {
        return nodes;
    }

    public void setNodes(List<TreeView> nodes) {
        this.nodes = nodes;
    }

    public Map<String, Boolean> getState() {
        return state;
    }

    public void setState(Map<String, Boolean> state) {
        this.state = state;
    }
}
